﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IService
{
    public interface IOmSalesOrderService
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="data">实体</param>
        /// <returns>结果</returns>
        Task<int> CreateAsync(OmSalesOrder data);

        /// <summary>
        /// 根据ID查询
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>用户列表</returns>
        Task<OmSalesOrder> GetByIdAsync(long Id);

        /// <summary>
        /// 查询所有
        /// </summary>
        /// <returns>用户列表</returns>
        Task<List<OmSalesOrder>> GetAllAsync();

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="date">包含更新信息</param>
        Task<int> UpdateAsync(OmSalesOrder date);

        /// <summary>
        /// 根据ID删除
        /// </summary>
        /// <param name="Id">ID</param>
        Task<int> DeleteAsync(long Id);
        /// <summary>
        /// 根据id获取“人”
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<UserOrgInfo> GetUsersId(long id);
        /// <summary>
        /// 根据货品编号获取库存
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<WhInventory>> GetInventoryId(string code);
        /// <summary>
        /// 获取订单数据
        /// </summary>
        /// <returns></returns>
        Task<List<SalesOrderDTO>> GetAllWithDetailsAsync();
        /// <summary>
        /// 根据id获取所有销售订单（优化版）
        /// </summary>
        Task<List<SalesOrderDTO>> GetAllWithDetailsIdAsync(long id);
        /// <summary>
        /// 根据编号获取所有销售订单（优化版）
        /// </summary>
        Task<List<SalesOrderDTO>> GetAllWithDetailsIdAsync(string id);
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        Task<int> UpdateAuditorComment(Auditor date);
        /// <summary>
        /// 状态更改
        /// </summary>
        /// <returns></returns>
        Task<int> AuditorStatus(string status, long id);
        /// <summary>
        /// 状态更改
        /// </summary>
        /// <returns></returns>
        Task<int> Status(string status, long id);
        /// <summary>
        /// 直接根据货品代码获取库存
        /// </summary>
        /// <param name="goodsCode"></param>
        /// <returns></returns>
        Task<List<WhInventory>> GetInventoryByGoodsCode(string goodsCode);
    }
}
